﻿<%@ page title="" language="VB" masterpagefile="~/promocionVenta.master" autoeventwireup="false" inherits="mantenedores_instanciasTP, App_Web_u7qadzpc" enableEventValidation="false" theme="PrincipalTheme" maintainScrollPositionOnPostBack="true" maxPageStateFieldLength="250" %>


<%@ MasterType VirtualPath="~/promocionVenta.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register Assembly="Flan.Controls" Namespace="Flan.Controls" TagPrefix="flan" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
#txtBuscar
{
width: 299px;
}
.filaEncabezadoPrincipal
{
background-image: url('../imagenes/px_td.jpg');
width: 100%;
background-repeat: repeat;
}
.filaEncabezadoTitulo
{
background-image: url('../imagenes/submenu3.PNG');
background-repeat: repeat;
}
.filaEncabezado
{
background-image: url('../imagenes/submenu3.PNG');
width: 100%;
background-repeat: repeat;
}
.colGrilla
{
background-image: url('../imagenes/submenu2.PNG');
height: 20px;
background-repeat: repeat;
}
.style1
{
width: 299px;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 100%; background-color: #f4f4f4;" cellspacing="0">
<tr class="filaEncabezadoPrincipal">
<td>
<table width="100%">
<tr>
<td>
<asp:Label ID="Label1" runat="server" CssClass="CeldaTituloTexto"
Text="INSTANCIAS DE SEGUIMIENTO : Bono Techo Propio"></asp:Label>
</td>
</tr>
</table>
</td>
</tr>
</table>
<asp:Panel ID="pnlTpoConstruccion" runat="server" Width="100%">
<table style="width: 100%; background-color: #f4f4f4" class="EditarLabel" cellspacing="0"
cellpadding="0" border="1">
<tbody>
<tr>
<td style="width: 100%; padding-top: 5px; padding-bottom: 3px">
</td>
</tr>
<tr>
<td style="width: 100%; padding-top: 5px; padding-bottom: 3px">
<asp:Button ID="btnAgregar" runat="server" Text="Nuevo" CausesValidation="False"
SkinID="btnNormalSkin" UseSubmitBehavior="False" />
</td>
</tr>
<tr>
<td>
<div style="width: 100%; height: 20px; scrollbar-face-color: #B5B5B5;" class="DivPanelGrillaEncabezado">
<table cellpadding="0" cellspacing="1" width="100%">
<tr align="center">
<td align="center" valign="middle" width="5%" class="colGrilla">
<asp:LinkButton ID="LinkButton1" runat="server" SkinID="lnkBtnEncabezado" CommandArgument="idTpoConstruccion"
CommandName="idTpoConstruccion" Height="100%">No.</asp:LinkButton>
</td>
<td align="center" valign="middle" width="10%" class="colGrilla">
<asp:LinkButton ID="lnkBtnCodigo" runat="server" SkinID="lnkBtnEncabezado" CommandArgument="idTpoConstruccion"
CommandName="idTpoConstruccion" Height="100%">Fecha Creación</asp:LinkButton>
</td>
<td align="center" valign="middle" width="30%" class="colGrilla">
<asp:LinkButton ID="lnkBtnNombre" runat="server" SkinID="lnkBtnEncabezado" CommandArgument="descTpoConstruccion"
CommandName="descTpoConstruccion" Height="100%">Nombre de la Instancia</asp:LinkButton>
</td>
<td align="center" valign="middle" width="10%" class="colGrilla">
<asp:LinkButton ID="lnkBtnEstado" runat="server" SkinID="lnkBtnEncabezado" CommandArgument="descEstado"
CommandName="descEstado" Height="100%">Estado</asp:LinkButton>
</td>
<td align="center" valign="middle" width="30%" class="colGrilla">
<asp:LinkButton ID="LinkButton2" runat="server" SkinID="lnkBtnEncabezado" CommandArgument="descEstado"
CommandName="descEstado" Height="100%">Registrado por</asp:LinkButton>
</td>
<td align="center" valign="middle" width="11%" class="colGrilla">
<asp:Label ID="lblEliminar" runat="server" Text="Eliminar" SkinID="lblEncabezado"></asp:Label>
</td>
</tr>
</table>
</div>
<div style="overflow-y: scroll; overflow-x: hidden; width: 100%; height: 470px; scrollbar-face-color: #B5B5B5;"
class="DivPanelGrillaCuerpo">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="gvwLista" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="0" ForeColor="Black"
GridLines="Vertical" Width="99%" Font-Names="Tahoma" DataKeyNames="idInstanciaTP"
SkinID="gvwListaSkin" ShowHeader="False" EnableSortingAndPagingCallbacks="True">
<Columns>

<asp:TemplateField HeaderText="Nro.">
<ItemTemplate>
<asp:LinkButton ID="lnkCodigo" runat="server" CausesValidation="False" CommandName="Edit"
ForeColor="Black" Height="20px" Style="display: block; text-decoration: none;"
Text='<%# Eval("idInstanciaTP") %>' CommandArgument='<%# Eval("idInstanciaTP") %>'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="5%" Height="20px" />
<ItemStyle HorizontalAlign="Center" Width="6%" Height="20px" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Fecha Creación">
<ItemTemplate>
<asp:LinkButton ID="lnkFecha" runat="server" CausesValidation="False" CommandName="Edit"
ForeColor="Black" Height="20px" Style="display: block; text-decoration: none;"
Text='<%# Eval("fechacreacion") %>' CommandArgument='<%# Eval("idInstanciaTP") %>'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="10%" Height="20px" />
<ItemStyle HorizontalAlign="Left" Width="10%" Height="20px" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Nombre de la Instancia">
<ItemTemplate>
<asp:LinkButton ID="lnkNombre" runat="server" CausesValidation="False" CommandName="Edit"
ForeColor="Black" Height="20px" Style="display: block; text-decoration: none;"
Text='<%# Eval("descInstanciaTP") %>' CommandArgument='<%# Eval("idInstanciaTP") %>'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="32%" Height="20px" />
<ItemStyle HorizontalAlign="Left" Width="32%" Height="20px" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Estado">
<ItemTemplate>
<asp:LinkButton ID="lnkEstado" runat="server" CausesValidation="False" CommandName="Edit"
ForeColor="Black" Height="20px" Style="display: block; text-decoration: none;"
Text='<%# Eval("descEstado") %>' CommandArgument='<%# Eval("idInstanciaTP") %>'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="10%" Height="20px" />
<ItemStyle HorizontalAlign="Center" Width="10%" Height="20px" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Registrado por">
<ItemTemplate>
<asp:LinkButton ID="lnkUsuario" runat="server" CausesValidation="False" CommandName="Edit"
ForeColor="Black" Height="20px" Style="display: block; text-decoration: none;"
Text='<%# Eval("descUsuario") %>' CommandArgument='<%# Eval("idInstanciaTP") %>'></asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="32%" Height="20px" />
<ItemStyle HorizontalAlign="Center" Width="32%" Height="20px" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="lnkEliminar" runat="server" CausesValidation="False"
ForeColor="Black" Height="20px" Style="display: block; text-decoration: none;"
CommandArgument='<%# Eval("idInstanciaTP") %>' ToolTip="Eliminar Instancia Techo Propio">
<asp:ImageButton ID="btnEliminar" runat="server" CommandName="Delete" ImageUrl="~/Imagenes/Procesos/borrar.png"
OnClientClick="return ConfirmaEliminacion(this);" Style="cursor: pointer" ToolTip="Eliminar Instancia Techo Propio"
CommandArgument='<%# Eval("idInstanciaTP") %>' />
</asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="12%" Height="20px" />
<ItemStyle HorizontalAlign="Center" Width="12%" Height="20px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</tbody>
</table>
</asp:Panel>

<ajax:ModalPopupExtender ID="mpDetalle" runat="server" TargetControlID="btnAgregar"
BackgroundCssClass="modalBackground" DropShadow="True" PopupControlID="pnlIngresar"
PopupDragHandleControlID="lblTitulo">
</ajax:ModalPopupExtender>
<asp:Panel ID="pnlIngresar" runat="server" CssClass="modalPopup" Width="401px"
Height="210px" Style="display: none">
<table cellpadding="0" cellspacing="0" class="style1" align="center" border="0" width="400px">
<tr>
<td class="style2" colspan="2" bgcolor="#E44146">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Label ID="lblTitulo" runat="server" SkinID="lblFormulario" Text="INSTANCIAS"
ToolTip="Registrar"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td class="style2" align="right" valign="middle">
&nbsp;
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel12" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtId" runat="server" Style="display: none;"></asp:TextBox></ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="right" class="style2" valign="middle">
&nbsp;
<asp:Label ID="Label2" runat="server" Text="Fecha: " SkinID="lblNormal"></asp:Label>
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<input id="txtFechaInstanciaTP" runat="server" autocomplete="off" class="CsstxtNormalObligatorio"
type="text" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>

<tr>
<td align="right" class="style2" valign="middle">
&nbsp;
<asp:Label ID="Label5" runat="server" Text="Nombre de la Instancia: " SkinID="lblNormal"></asp:Label>
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<input id="txtInstanciaTP" runat="server" autocomplete="off" class="CsstxtNormalObligatorio" onkeypress="return validarSoloLetras(event);" type="text" maxlength="55" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>

<tr>
<td align="right" class="style2">
<asp:Label ID="Label13" runat="server" Text="Estado: " SkinID="lblNormal"></asp:Label>
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel11" runat="server">
<ContentTemplate>
<select id="selEstado" runat="server" class="CssddlNormal" name="selEstado">
<option></option>
</select>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>

<tr>
<td align="right" class="style2" valign="middle">
&nbsp;
<asp:Label ID="Label3" runat="server" Text="Registrado por: " SkinID="lblNormal"></asp:Label>
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel5" runat="server">
<ContentTemplate>
<input id="txtNombreUsuario" runat="server" autocomplete="off" class="CsstxtNormalObligatorio"
type="text" maxlength="55" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>

<tr>
<td class="style2" align="right" valign="middle">
&nbsp;
</td>
<td>
&nbsp;
</td>
</tr>
<tr>
<td align="right" class="style2" valign="middle" >
&nbsp;
<asp:Button ID="btnGuardar" runat="server" CausesValidation="False" SkinID="btnNormalSkin"
Text="Guardar" OnClientClick="return validar();" />
</td>
<td>
<asp:Button ID="btnCancelar" runat="server" CausesValidation="False" SkinID="btnNormalSkin"
Text="Cancelar" />
</td>
</tr>
<tr>
<td class="style2">
&nbsp;
</td>
<td>
&nbsp;
</td>
</tr>
</table>
</asp:Panel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="divProgress" class="divProgreso">
<img src="../imagenes/ajax-loader.gif" align="middle" alt="Procesando" />
<asp:Label ID="lblprogreso" runat="server" Text=" Procesando..." CssClass="EditarLabel"></asp:Label>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<flan:UpdateProgressOverlayExtender ID="UpdateProgressOverlayExtender1" runat="server"
CssClass="updateProgress" OverlayType="Browser" TargetControlID="UpdateProgress1"/>
<script language="javascript" type="text/javascript">
function ConfirmaEliminacion(sender) {
return confirm('¿Está seguro que desea eliminar la instancia?\n' + sender.alt);
}
function MuestraPanel() {
limpiarControles();
$find(mpDetalle).show();
return true;
}
function limpiarControles() {
    document.getElementById('ctl00$ContentPlaceHolder1$txtInstanciaTP').value = '';
    document.getElementById('ctl00$ContentPlaceHolder1$selEstado').selectedIndex = 0;
    document.getElementById('ctl00$ContentPlaceHolder1$selEstado').disabled = 'disabled';
}
function validar() {
    if (document.getElementById('ctl00$ContentPlaceHolder1$txtInstanciaTP').value == '') {
        alert('Debe ingresar la Instancia para Techo Propio');
        document.getElementById('ctl00$ContentPlaceHolder1$txtInstanciaTP').focus();
        return (false);
    }
}
</script>
</asp:Content>

